home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / bcfamily / source / dosfind.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-12  |  1.1 KB  |  57 lines

  1. //
  2. //      *******************************************************************
  3. //        JdeBP C++ Library Routines          General Public Licence v1.00
  4. //            Copyright (c) 1991,1992     Jonathan de Boyne Pollard
  5. //      *******************************************************************
  6. //
  7. // Part of FamAPI.LIB
  8. //
  9.  
  10. #include "famapi.h"
  11. #include "dosdos.h"
  12.  
  13. //
  14. //    DOS Set DTA
  15. //
  16. void _APICALL
  17. DosDosSetDTA ( const void far *DTA )
  18. {
  19.     asm push ds ;
  20.     _DS = FP_SEG(DTA) ;
  21.     _DX = FP_OFF(DTA) ;
  22.     _AX = 0x1a00 ;
  23.     Dos3Call() ;
  24.     asm pop ds ;
  25. }
  26.  
  27. //
  28. //    DOS Find first occurrence of a file
  29. //
  30. USHORT _APICALL
  31. DosDosFindFirst ( const char far *FileName,
  32.                   unsigned short Attr,
  33.                   struct DOSFind_t far *find)
  34. {
  35.     DosDosSetDTA(find) ;
  36.     asm push ds ;
  37.     _DS = FP_SEG(FileName) ;
  38.     _DX = FP_OFF(FileName) ;
  39.     _CX = Attr ;
  40.     _AX = 0x4e00 ;
  41.     Dos3Call() ;
  42.     asm pop ds ;
  43.     if (_FLAGS & 0x0001) return _AX ; else return NO_ERROR ;
  44. }
  45.  
  46. //
  47. //    DOS Find next occurrence of a file
  48. //
  49. USHORT _APICALL
  50. DosDosFindNext    ( struct DOSFind_t far * find)
  51. {
  52.     DosDosSetDTA(find) ;
  53.     _AX = 0x4f00 ;
  54.     Dos3Call() ;
  55.     if (_FLAGS & 0x0001) return _AX ; else return NO_ERROR ;
  56. }
  57.